13. Project Challenge

Project Challenge (Optional)

Want your project to stand out? If yes, then you came to the right place. So far, you manually drove your robot and localized it with AMCL. In addition, you used the ROS navigation stack which planned a trajectory and drove your robot from start to goal. Now, the challenge is to create a node that will autonomously drive the robot through a series of waypoints. The robot will rely on AMCL poses to localize itself with respect to each waypoint.

Here's a sneak peek of the final outcome:

Localization Challenge

Since you decided to tackle this challenge, we will provide you with some hints. First, you will need to create a drive_bot package. Inside this package, create a drive_bot cpp node that will autonomously drive the robot. The challenge is divided into multiple tasks as follows:

Waypoints

As mentioned earlier, your robot will autonomously drive through a series of waypoints which you will have to pre-define them in your code. Each of these waypoints holds a position and orientation. As your robot reaches a waypoint, it will change either its orientation or position. There are many methods you can use in order to select your waypoints:

  • You can choose to drive your robot manually, echo the AMCL data, and record a waypoint pose whenever you reach it.
  • In Gazebo, you can change the robot position and orientation then check the robot poses values inside the tree. Note that orientations in Gazebo are represented as Euler angles whereas AMCL orientations are represented as quaternion angles.
  • In Rviz, you can use the select tool, and then click and drag the robot to identify its pose. Make sure to first enable the tool under Panels->Selection.
  • Another option is to change the robot pose in Gazebo, check RViz to see if your robot is localizing properly, and then read its AMCL pose value.

To successfully pass this challenge and make your project stand out, you will need to define at least five distant waypoints for your robot to reach.

Subscriber

Your robot will have to subscribe to the AMCL data to constantly compare its pose with the upcoming pre-defined waypoint pose. You will find it useful to define a threshold to accommodate for errors.

Driving

If the robot pose is equal to a waypoint pose, the robot wheels should be actuated to change its position or orientation. Thus, you will have to define the robot movements. The robot should have the ability to move forward, left, right and stop. Also, you have to define your robot speed. Keep it low for better stability.

Publisher:

To change your robot position and orientation, you will need to publish the driving commands to the robot’s wheels.

Challenge

Task Description:

Let's recap the steps that you need to take in order to pass this challenge. Check them off as you complete them.

Task List:

Task Feedback:

Great Job!!!